<?php 
require '../../frame/base.php';
	$page = 0;
	$pagesize = 10;
	if(isset($_GET['page'])){
		$page = (int)$_GET['page'];
	}
	if(isset($_GET['pagesize'])){
		$pagesize = (int)$_GET['pagesize'];
	}
	$page *= $pagesize;

	$result = $Db->table('categroy')->field("cateid,name")->where(array('show_app'=>1))->order('cateid')->select();
	if(is_array($result)){
		$data = array('cateList'=>$result,'cateId'=>0,'defaultFenlei'=>array(),'hotFenlei'=>array());
		if($result){
			$cateId = $result[0]['cateid'];
			$data['cateId'] = $cateId;
			$data['hotFenlei'] = $Db->table('zifenlei')->where(array('fenleiid'=>$cateId,'isHot'=>1))->select();
			$data['defaultFenlei'] = $Db->table('zifenlei')->where(array('fenleiid'=>$cateId,'isHot'=>0))->limit($page,$pagesize)->select();
		}
		echo json_encode(array('code'=>200,'msg'=>'ok','data'=>$data));
	}else{
		echo json_encode(array('code'=>-200,'msg'=>'获取失败'));
	}




 ?>